package com.zsj.qzt_punch.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

import java.util.concurrent.Executors;


//定时器配置
@Configuration
public class ScheduleConfig implements SchedulingConfigurer {


    //建立线程池来保证定时器任务的并发
    @Override
    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
        taskRegistrar.setScheduler(Executors.newScheduledThreadPool(5));
    }


}
